package com.center.growcenterserver.controller;


import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.center.growcenterserver.common.R;
import com.center.growcenterserver.model.domain.GraduateResearchProcess;
import com.center.growcenterserver.service.GradeService;
import com.center.growcenterserver.service.GrpService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

/**
 * 个人成长系统的核心功能，用于显示保研信息、考研小组件以及就业信息查询功能
 */
@Slf4j
@RestController
@RequestMapping("/grp")
public class GrpController {
    @Autowired
    private GrpService grpService;

    @GetMapping("/baoyan")
    public R graduateresearchprocess(@RequestParam(defaultValue = "1") int curPage, @RequestParam(defaultValue = "100") int pageSize) {
        IPage<GraduateResearchProcess> page = new Page<>(curPage, pageSize);
        return grpService.allContents(page);
    }

    // 新增的岗位信息查询接口
    @GetMapping("/job")
    public R getJobPositions(@RequestParam(defaultValue = "1") int curPage,
                             @RequestParam(defaultValue = "10") int pageSize,
                             @RequestParam(required = true) String jobname) {
//        jobname = "C++";
        return grpService.getAllJobmessage(jobname);
    }

}
